package com.czk.ssacharmemory.config;

import com.alibaba.cloud.ai.memory.redis.LettuceRedisChatMemoryRepository;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: chenzhangkun
 * @CreateTime: 2025-10-19
 * @Description: 配置redisChatMemory
 * @Version: 1.0
 */
@Configuration
public class RedisMemoryConfig {
    @Value("${spring.data.redis.host}")
    private String host;
    @Value("${spring.data.redis.port}")
    private int port;

    @Bean
    public LettuceRedisChatMemoryRepository redisChatMemoryRepository() {
        return LettuceRedisChatMemoryRepository.builder()
                .host(host)
                .port(port)
                .build();
    }

}
